import {createRouter, createWebHistory} from 'vue-router'

const routes = [
    {
        path: '/',
        name: 'main',
        component: () => import('../views/MainView.vue'),
        children: [
            {
                path: 'welcome',
                component: () => import('../views/main/base/WelcomeView.vue')
            },
            {
                path: 'about',
                component: () => import('../views/main/about/AboutView.vue')
            },
            {
                path: 'base/',
                children: [
                    {
                        path: 'station',
                        component: () => import('../views/main/base/StationView.vue')
                    },
                    {
                        path: 'train',
                        component: () => import('../views/main/base/TrainView.vue')
                    },
                    {
                        path: 'train-station',
                        component: () => import('../views/main/base/TrainStationView.vue')
                    },
                    {
                        path: 'train-carriage',
                        component: () => import('../views/main/base/TrainCarriageView.vue')
                    },
                    {
                        path: 'train-seat',
                        component: () => import('../views/main/base/TrainSeatView.vue')
                    }
                ]
            },
            {
                path: 'batch/',
                children: [
                    {
                        path: 'job',
                        component: () => import('@/views/main/batch/JobView.vue')
                    }
                ]
            },
            {
                path: 'business/',
                children: [
                    {
                        path: 'daily-train',
                        component: () => import('@/views/main/business/DailyTrainView.vue')
                    },
                    {
                        path: 'daily-train-station',
                        component: () => import('@/views/main/business/DailyTrainStationView.vue')
                    },
                    {
                        path: 'daily-train-carriage',
                        component: () => import('@/views/main/business/DailyTrainCarriageView.vue')
                    },
                    {
                        path: 'daily-train-seat',
                        component: () => import('@/views/main/business/DailyTrainSeatView.vue')
                    },
                    {
                        path: 'daily-train-ticket',
                        component: () => import('@/views/main/business/DailyTrainTicketView.vue')
                    },
                    {
                        path: 'confirm-order',
                        component: () => import('@/views/main/business/ConfirmOrderView.vue')
                    }
                ]
            },
            {
                path: 'member/',
                children: [
                    {
                        path: 'ticket',
                        component: () => import('../views/main/member/TicketView.vue')
                    }
                ]
            }
        ]
    },
    {
        path: '/about',
        name: 'about',
        component: () => import('../views/main/about/AboutView.vue')
    },
    {
        path: '',
        redirect: '/welcome'
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
